package com.janj.controller;

import com.janj.bean.Phone;
import com.janj.bean.Student;
import com.janj.service.OneToOneService;
import com.janj.service.OneToOneServiceImpl;
import org.junit.Test;

import java.util.List;

public class OneToOneDemo {
    @Test
    public void testSelectOneToOne(){
        OneToOneService service = new OneToOneServiceImpl();
        List<Student> array = service.selectOneToOne();
        System.out.println("--------------");
        for (Student student : array) {
            Phone p = student.getP();
            System.out.println(student.getSid()+","+student.getSname()+","+student.getAge()+","+p.getNumber());
        }
     }
}
